package cn.itcast.order.mapper;

import cn.itcast.order.pojo.SeataFreezeTb;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface SeataFreeTbMapper {

    @Insert("INSERT INTO seata_freeze_tb(x_id,order_id,freeze_num,state ) VALUES (#{xid},#{orderId},#{freezeNum},#{aTry})")
    void insert(String xid, int orderId, int freezeNum, int aTry);

    @Delete("delete from seata_freeze_tb where x_id = #{xId}")
    int delete(String xId);

    @Select("select * from seata_freeze_tb where x_id = #{xId}")
    SeataFreezeTb selectByXid(String xId);

    @Update("update seata_freeze_tb set freeze_num = #{num},state = #{state} where id = #{id}")
    int updateById(int id, int num, int state);
}
